<?php
/*
 * description：
 * author：wh
 * email：
 * createTime：{2019/12/27} {9:44} 
 */

namespace libraries;

use think\Db;
class ServiceTools
{

    static function getSceneDescription($scene_code, $from = [], $replace = []){

        $scene = Db::name('web_sceneconf')->where(['scene_code'=>$scene_code, 'is_deleted'=>0])->find();
        //scene 保存的是sceneconf表id
        $data = Db::name('web_emailconf')->where(['scene'=>$scene['id'], 'is_deleted'=>0])->find();

        $data['scene_description'] = htmlspecialchars_decode($data['scene_description']);

        $data['scene_description'] = template_replace($data['scene_description'], $from, $replace);
        return $data;
    }
}